package com.demo;

//正方形
public class Square  extends Shape{
    private double side;
    public Square(double side){
        super("正方形");
        this.side=side;
    }
    //面积
    @Override
    public double getArea() {
        return side*side;
    }
    //周长
    @Override
    public double getPerimeter() {
        return side*4;
    }
}
